package com.ljy.my_study.java.juc.locksupport;

import java.util.concurrent.locks.LockSupport;

public class TestMain {

    public static void main(String[] args) throws InterruptedException {
        Thread t1=new Thread(()->{
            new TestMain().test();
        });
        t1.start();
        Thread.sleep(1000L);
        LockSupport.unpark(t1);
        System.out.println("main end:"+System.currentTimeMillis());
    }

    public void test(){
        System.out.println("start:"+System.currentTimeMillis());
        LockSupport.parkNanos(10_000_000_000L);
        System.out.println("end:"+System.currentTimeMillis());
    }
}
